<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty {eval} function plugin
 *
 * Type:     function<br>
 * Name:     eval<br>
 * Purpose:  evaluate a template variable as a template<br>
 * @link http://smarty.php.net/manual/en/language.function.eval.php {eval}
 *       (Smarty online manual)
 * @author Monte Ohrt <monte at ohrt dot com>
 * @param array
 * @param Smarty
 */
function smarty_function_user($params, &$smarty)
{

    if (!isset($params['get'])) {
        $smarty->trigger_error("eval: missing 'get' parameter");
        return;
    }
    switch ($params['get']) {
    	case 'name' : return V_User::getName();
    	case 'group' : return V_User::getGroup();
    }
}

/* vim: set expandtab: */

?>
